# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test03
# Description:  例6.3
# Author:       ASUS
# Date:         2019/3/4
#-------------------------------------------------------------------------------


# 通过 % 进行格式化
values1 = (1,3,"hello")
str1 = "abc %d,xyz %d,%s world"
print(str1 % values1)

# 通过定义字典和format_map方法进行格式化
values2 = {'title':'极客起源','ur1':'https://geekori.com','company':'欧瑞科技'}
str2 = """
<html>
 <head>
   <title>{title}</title>
   <meta charset="utf-8" />
 <head>
 <body>
   <h1>{title}</h1>
   <a href="{ur1}">{company}</a>
 </body>
</html>
"""
print(str2.format_map(values2))



